package com.wtwd.device.model.dto;


import com.wtwd.device.constant.LangEnum;
import com.wtwd.device.constant.SeparatorConstant;
import com.wtwd.device.util.StringUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * @author zdl
 * @date 2023/10/25 15:42
 */
@ApiModel
public class SMSConfiguration {

    @ApiModelProperty(value = "签名")
    private String signature;

    @ApiModelProperty(value = "摸版")
    private Map<String, String> template;

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public Map<String, String> getTemplate() {
        return template;
    }

    public void setTemplate(Map<String, String> template) {
        this.template = template;
    }

    public String getTemplateByLangAndType(String lang, String type) {
        lang = StringUtil.isEmpty(lang) ? LangEnum.ZH.name() : lang;
        return this.template.get(lang + SeparatorConstant.EN_DASH1 + type);
    }
}
